<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	  xmlns:c="http://java.sun.com/jsp/jstl/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">
	<h:head>
	</h:head>
	<f:metadata>
    	<f:viewParam name="partyname" value="#{personalPageBean.party.name}"/>
	</f:metadata>
	<h:body>
	
		<p:notificationBar position="top" effect="slide" widgetVar="bar" styleClass="top">
               		<c:forEach items="#{personalPageBean.requestList}" var="req">
               			<h:panelGrid columns="4">
            				<h:outputLabel value="#{req.citizen.fullName}" />
            				<h:outputLabel value=" is asking to become a member of " />
            				<h:outputLabel value="#{personalPageBean.party.name}" />
            				<h:link outcome="/citizen/joinvote/votememberjoin"> Vote!
            				<f:param  name="jrid" value="#{req.ID}" />
            				</h:link>
            			</h:panelGrid>	
            		</c:forEach>
            		<p:commandButton id="hidebtn" value="Hide notification" onclick="PF('bar').hide()" type="button" />
         </p:notificationBar>
		<ui:include src="../horizontal_menu.xhtml">
		</ui:include>
		<c:choose>
		<c:when test="#{personalPageBean.memberOfParty}">
				
			<p:panel id="panel"  style="margin-bottom:10px;">
				<f:facet name="header" >
						<h:outputLabel value="#{personalPageBean.party.name}" />
                </f:facet>
                <f:facet name="actions">
                		<p:commandButton id="showbtn" styleClass="ui-panel-titlebar-icon " value="#{('Notification['.concat(personalPageBean.numberOfNotification).concat(']'))}" onclick="PF('bar').show()" type="button" />
                </f:facet>
        		<h:panelGrid columns="2">
        		
            		<h:outputLabel for="symbol" value="Symbol:" />
            		<h:graphicImage value="#{('../partysymbols/'.concat(personalPageBean.party.symbol))}" width="200" height="171" />
 
            		<h:outputLabel for="program" value="Program:" />
            		<h:outputLabel id="program" value="#{personalPageBean.party.program}" />
            		<h:link id="partyname" outcome="/memberlist" value="memberlist">
            			<f:param  name="partyname" value="#{personalPageBean.party.name}" /> 
            		</h:link>
            		
        		</h:panelGrid>
        	</p:panel>
		</c:when>	
		<c:otherwise>
			<h1>You aren't member of a party.</h1>
			<h:link outcome="personalpage">my personal page</h:link>
		</c:otherwise>
		</c:choose>
	</h:body>
</html>